package com.payment.service;

import com.alipay.v3.ApiException;
import com.payment.domain.dto.OrderPaymentDto;
import com.payment.domain.dto.OrderPaymentDtoRefundDto;
import com.payment.domain.pojo.PaymentRecord;
import com.baomidou.mybatisplus.extension.service.IService;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

import java.io.IOException;

/**
 * <p>
 * 支付记录表 服务类
 * </p>
 *
 * @author 小杰大人
 * @since 2025-09-29
 */
public interface IPaymentRecordService extends IService<PaymentRecord> {
    /**
     * 发起付款
     * @param orderPaymentDto 订单信息
     * @return 付款界面
     */
    String initiatePayment(OrderPaymentDto orderPaymentDto);


    /**
     * 支付异步回调
     */
    void paymentCallback(HttpServletRequest request, HttpServletResponse response) throws IOException, ApiException;

    /**
     * 查询付款结果
     * @param orderNo
     * @return
     */
    Boolean queryPaymentResult(String orderNo);

    /**
     * 取消付款 关闭订单
     * @param orderNo
     */
    Boolean cancel(String orderNo);


    PaymentRecord querySelectByOrderNo(String orderNo);

    Boolean paymentSuccess(String orderNo);
}
